package com.ktjy.crm.service;

import jakarta.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;

import java.io.Serializable;

@Service("redisService")
public class RedisService {
    private static final Logger logger = LoggerFactory.getLogger(RedisService.class);
    @Resource
    public RedisTemplate redisTemplate;

    public boolean set(final String key,Object value){
        boolean result = false;
        try {
            ValueOperations<Serializable,Object> operations = redisTemplate.opsForValue();
            result = true;
        }catch (Exception e){
            logger.error("redis error",e);
        }
        return result;
    }
}
